#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
        int n = 0;
        cin >> n;
        vector<int> highs(n, 0);
        for(int i = 0; i < n; i++){
                cin >> highs[i];
        }
        vector<int> dp(n, 1);
        reverse(highs.begin(), highs.end());
        for(int i = 1; i < n; i++){
                for(int j = 0; j < i; j++){
                        if(highs[i] >= highs[j]){
                                dp[i] = max(dp[i], dp[j] + 1);
                        }
                }
        }
        cout<<*max_element(dp.begin(), dp.end())<<endl;
        return 0;
}